<?php
header('Content-type:image/png');
$res = imagecreatetruecolor(500,500);
$red = imagecolorallocate($res,255,0,0);
$green = imagecolorallocate($res,0,255,0);
imagefill($res,0,0,$red);
$font = realpath('Source.otf');
$size = 16;
$text = 'houdunren.com';
//imagettftext($res,50,0,0,50,$green,$font,'houdunren.com');
$box = imagettfbbox($size,0,$font,$text);
$width = $box[2] - $box[0];
$height = $box[1] - $box[7];
imagettftext($res,$size,0,250-$width/2,250-$height/2,$green,$font,$text);
imagepng($res);
imagedestroy($res);